<?php
	function db_connect($db_name, $db_port, $db_sid, $acc_user, $acc_pwd)
	{
		$conn = "(DESCRIPTION=
					(ADDRESS_LIST=
						(ADDRESS=(PROTOCOL=TCP)(HOST=".$db_name.")(PORT=".$db_port."))
					)
					(CONNECT_DATA=(SID=".$db_sid.")(SERVER=DEDICATED))
				)";
				
		$c = @oci_connect($acc_user, $acc_pwd, $conn);
		
		return $c;
	}
	
	function db_connect_ses()
	{
		$conn = "(DESCRIPTION=
					(ADDRESS_LIST=
						(ADDRESS=(PROTOCOL=TCP)(HOST=".$_SESSION['db_name'].")(PORT=".$_SESSION['db_port']."))
					)
					(CONNECT_DATA=(SID=".$_SESSION['db_sid'].")(SERVER=DEDICATED))
				)";
				
		$c = @oci_connect($_SESSION['db_user'], $_SESSION['db_pass'], $conn);
		
		return $c;
	}
?>